package com.xcity.pomelo.response;

import java.util.List;

import com.xcity.game.common.GameStaticConfig;
import com.xcity.game.common.PlayerPool;
import com.xcity.game.employee.config.impl.EmployeeRecruitConfigure;
import com.xcity.game.employee.config.impl.EmployeeRecruitConfigure.EmployeeRecruitResult;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class EmployeeRecruitResponse extends Response {
////-------OLD
//	private int id;
//	private String name;
//	private String icon;
//	private int height;
//	private int weight;
//	@JSONField(name = "IQ")
//	private int IQ;
//	@JSONField(name = "EQ")
//	private int EQ;
//	@JSONField(name = "AQ")
//	private int AQ;
//	private int luck;
//	private List<Skill> skills;
//	
//	public static class Skill {
//		private int id;
//		private String name;
//		private String desc;
//	}
//	
//	
//	public EmployeeRecruitResponse(int serial) {
//		super(serial);
//	}
////-------OLDEND
	public int leftFreeCount = -1;//剩余免费次数 (金币1钻石1)
	public int moneyLeftRollCount = -1;//金币剩余抽次(金币1 10 100)
	public int stoneNext = -1;//下几次必出员工(钻石1 10)
	public int leftHalfCount = -1;//半价剩余次数(钻石1)
	public int stoneTenSequentCost = -1;//下一次连续钻石十抽消耗(钻石10连)
	public int stoneTenNextCost = -1;//下一次钻石10抽消耗(钻石10)
	public int stoneHalf10 = -1;//钻石10抽半价 -1:无变化 0:有半价  1:无半价
	public int type;
	public List<EmployeeRecruitResult> list;
	public EmployeeRecruitResponse(int serial, int type, List<EmployeeRecruitResult> resultList, int curCount, int todayFreeCount, int todayRollCount, int todayHalfCount, int stoneFixDropNext, int half10) {
		super(serial);
		this.type = type;
		this.list = resultList;
		
		if(type == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_ONE){
			leftFreeCount = GameStaticConfig.recruitMoneyFreeCount - todayFreeCount;
			moneyLeftRollCount = GameStaticConfig.recruitMoneyCountLimit1 - todayRollCount;
		}else if(type == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_TEN){
			moneyLeftRollCount = GameStaticConfig.recruitMoneyCountLimit10 - todayRollCount;
		}else if(type == EmployeeRecruitConfigure.RECRUIT_TYPE_MONEY_HUNDRED){
			moneyLeftRollCount = GameStaticConfig.recruitMoneyCountLimit100 - todayRollCount;
		}else if(type == EmployeeRecruitConfigure.RECRUIT_TYPE_STONE_ONE){
			leftFreeCount = GameStaticConfig.recruitStoneFreeCount - todayFreeCount;
			if(stoneFixDropNext > -1){
				stoneNext = stoneFixDropNext;
			}else{
				stoneNext = 10 - (curCount % 10);
			}
			if(todayHalfCount == 0){
				leftHalfCount = 1;
			}else{
				leftHalfCount = 0;
			}
		}else if(type == EmployeeRecruitConfigure.RECRUIT_TYPE_STONE_TEN){
			stoneNext = 10 - (curCount % 10);
			this.stoneHalf10 = half10;
			stoneTenSequentCost = GameStaticConfig.recruitCostStoneTenSequent;
			stoneTenNextCost = GameStaticConfig.recruitCostStoneTen;
			if(this.stoneHalf10 == 0){
				stoneTenNextCost = stoneTenNextCost >> 1;
				stoneTenSequentCost = stoneTenSequentCost >> 1;
			}
			
		}
	}
}
